using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace Chimera2.Classes
{
    public class Hub
    {
        private string hubName;
        [XmlAttribute("Hubname")]
        public string HubName
        {
            get { return hubName; }
            set { hubName = value; }
        }

        private string hubAddress;
        [XmlAttribute("Address")]
        public string HubAddress
        {
            get { return hubAddress; }
            set { hubAddress = value; }
        }
        
        private Guid guid;
        [XmlAttribute("GUID")]
        public Guid Guid
        {
            get { return guid; }
            set { guid = value; }
        }

        private bool active;
        [XmlAttribute("Active")]
        public bool Active
        {
            get { return active; }
            set { active = value; }
        }

        private bool isConnected;
        [XmlIgnore]
        public bool IsConnected
        {
            get { return isConnected; }
            set { isConnected = value; }
        }

        private bool isManualDisconnect;
        [XmlIgnore]
        public bool IsManualDisconnect
        {
            get { return isManualDisconnect; }
            set { isManualDisconnect = value; }
        }

        private string hubBotName;
        [XmlAttribute("HubBotname")]
        public string HubBotName
        {
            get { return hubBotName; }
            set { hubBotName = value; }
        }

        private string botName;
        [XmlAttribute("Botname")]
        public string BotName
        {
            get { return botName; }
            set { botName = value; }
        }

        private bool overrideBotName;
        [XmlAttribute("OverrideName")]
        public bool OverrideBotName
        {
            get { return overrideBotName; }
            set { overrideBotName = value; }
        }

        private string botPassword;
        [XmlAttribute("Password")]
        public string BotPassword
        {
            get { return botPassword; }
            set { botPassword = value; }
        }
        
        /// <summary>
        /// Shallow copies the Hub instance.
        /// </summary>
        public Hub Clone()
        {
            Hub h = (Hub)MemberwiseClone();

            h.Guid = System.Guid.NewGuid();
            return h;
        }
    }
}
